<% layout('/layouts/default.html', {title: '游泳馆申请管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('游泳馆入驻管理')}
			</div>
			<div class="box-tools pull-right">
<!-- 				<% if(hasPermi('natatoriumapply:natatoriumApply:edit')){ %> -->
<!-- 					<a href="${ctx}/natatoriumapply/natatoriumApply/form" class="btn btn-default btnTool" title="${text('新增游泳馆申请')}"><i class="fa fa-plus"></i> ${text('新增')}</a> -->
<!-- 				<% } %> -->
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${natatoriumApply}" action="${ctx}/natatoriumapply/natatoriumApply/listData" method="post" class="form-inline"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('游泳馆名称')}：</label>
					<div class="control-inline">
						<#form:input path="name" maxlength="80" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('申请状态')}：</label>
					<div class="control-inline">
						<#form:select path="applyState" dictType="apply_state" blankOption="true" class="width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text('游泳馆名称')}', name:'name', index:'a.name', width:150, align:"center", frozen:true},
		{header:'${text('联系人')}', name:'contactPerson', index:'a.contact_person', width:150, align:"center"},
		{header:'${text('联系方式')}', name:'contactWay', index:'a.contact_way', width:150, align:"center"},
		{header:'${text('申请状态')}', name:'applyState', index:'a.apply_state', width:150, align:"center", formatter: function(val, obj, row, act){
			var actions = [];
			var applyState = row.applyState
			if(applyState == 1){
				actions.push('<div style="color:#fff;margin-top:15px;width:60%;height:30px;line-height:30px;text-align:center;background:#81C784;margin-left:20%" title="${text("待处理")}">待处理</div>&nbsp;');
			} else if(applyState == 2){
				actions.push('<div style="color:#fff;margin-top:15px;width:60%;height:30px;line-height:30px;text-align:center;background:#66BB6A;margin-left:20%" title="${text("已通过")}">已通过</div>&nbsp;');
			} else if(applyState == 3){
				actions.push('<div style="color:#fff;margin-top:15px;width:60%;height:30px;line-height:30px;text-align:center;background:#4CAF50;margin-left:20%" title="${text("已拒绝")}">已拒绝</div>&nbsp;');
			}
			return actions.join('');
		}},
		{header:'${text('创建时间')}', name:'createDate', index:'a.create_date', width:150, align:"center"},
		{header:'${text('操作')}', name:'actions', width:120, sortable:false, title:false,align:"center", formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('natatoriumapply:natatoriumApply:edit')){ %>
				actions.push('<a href="${ctx}/natatoriumapply/natatoriumApply/details?id='+row.id+'" class="btnList btn-operation" title="${text('查看')}"><i class="fa ">查看</i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>